import java.util.Scanner;

public class demo03 {
    //日期问题
    public static boolean check(int year){
        if((year%4==0&&year%100!=0)||(year%400==0)){
            return true;
        }
        return false;
    }
    public static void func(int[] arr,int i,int j,int k){
        int year=arr[i];
        int month=arr[j];
        int day=arr[k];
        if(month<=12&&day<=31) {
            if(check(year)&&month==2&&day>29){

            }else if(!check(year)&&month==2&&day>28){

            }else {
                if(arr[i]<10){
                    System.out.print("200" + arr[i]);
                }else{
                    System.out.print("20" + arr[i]);
                }
                if(arr[j]<10){
                    System.out.print("-0" + arr[j] );
                }else{
                    System.out.print("-" + arr[j] );
                }
                if(arr[k]<10){
                    System.out.println("-0" + arr[k]);
                }else{
                    System.out.println("-" + arr[k]);
                }
            }
        }
    }
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String str=sc.nextLine();
        String[] arr=new String[3];
        arr=str.split("/");
        int[] arr1=new int[3];
        for (int i = 0; i < 3; i++) {
            arr1[i]=Integer.valueOf(arr[i]);
        }
        if(arr1[0]==arr1[1]&&arr1[1]==arr1[2]){
            func(arr1,0,1,2);
        } else if (arr1[0]==arr1[1]) {
            func(arr1, 0, 1, 2);
            func(arr1, 2, 1, 0);
        } else if (arr1[0]==arr1[2]) {
            func(arr1, 0, 1, 2);
            func(arr1, 2, 0, 1);
        } else if (arr1[1]==arr1[2]) {
            func(arr1, 0, 1, 2);
            func(arr1, 2, 0, 1);
            func(arr1, 2, 1, 0);
        }else {
            func(arr1, 0, 1, 2);
            func(arr1, 2, 0, 1);
            func(arr1, 2, 1, 0);
        }
    }
}
